package com.green.voluntaryfiling.util;


public class PhysicsRankingByScoreUtil {

    /**
     *
     * @param score 学生输入分数
     * @param ranking 学生输入排位
     * @param realRanking 算法匹配的排位
     * @return
     */
    public static boolean isRankingByScore(int score,int ranking,int realRanking){

       if(score>=650){
           int bottomRanking = realRanking -300;
           int topRanking =realRanking +300;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }

       }else if(score>=600){
           int bottomRanking = realRanking -1200;
           int topRanking =realRanking +1200;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=575){
           int bottomRanking = realRanking -1500;
           int topRanking =realRanking +1500;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=550){
           int bottomRanking = realRanking -1900;
           int topRanking =realRanking +1900;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=525){
           int bottomRanking = realRanking -2200;
           int topRanking =realRanking +2200;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=500){
           int bottomRanking = realRanking -2500;
           int topRanking =realRanking +2500;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=350) {
           int bottomRanking = realRanking - 3000;
           int topRanking = realRanking + 3000;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }else if(score>=300) {
           int bottomRanking = realRanking - 2000;
           int topRanking = realRanking + 2000;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }else if(score>=250) {
           int bottomRanking = realRanking - 1400;
           int topRanking = realRanking + 1400;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }else if(score>=200) {
           int bottomRanking = realRanking - 1000;
           int topRanking = realRanking + 1000;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }


        return false;
    }
}
